package com.massimilla.test;

import java.util.*;

public class Triangle {

	public static void main(String[] args) {
		boolean restart = false;
		int ang1;
		int ang2;
		int ang3;
		do {
			// Obtaining angles
			System.out.println("Provide the tirangle's angles");
			Scanner angle1 = new Scanner(System.in);
			ang1 = angle1.nextInt();
			Scanner angle2 = new Scanner(System.in);
			ang2 = angle2.nextInt();
			Scanner angle3 = new Scanner(System.in);
			ang3 = angle3.nextInt();

			// Denies if the triangle is illogical
			if (ang1 + ang2 + ang3 != 180) {
				System.out.println("That triangle is illogical. Try again!");
				restart = true;
			} else {
				restart = false;
			}
			angle1.close();
			angle2.close();
			angle3.close();

		} while (restart == true);

		// Defines triangle type
		if (ang1 == ang2 && ang2 == ang3) {
			System.out.println("Your triangle is equalatoral");
		} else if (ang1 != ang2 && ang1 != ang3 && ang2 != ang3) {
			System.out.println("Your triangle is scalene");
		} else if (ang1 == ang2 || ang3 == ang1 || ang2 == ang3) {
			System.out.println("Your triangle is isosceles");
		} else if (ang1 == 90 || ang2 == 90 || ang3 == 90);
			System.out.println("Your triangle is also right");
		}

	}


